﻿@model IEnumerable<WebApplication1.Models.PersonViewModel>

@{
    ViewData["Title"] = "Index";
}

<h2>Index</h2>

<p>
    <a asp-action="Create">Create New</a>
</p>
<div class="row">
    <p class="col-md-8">
        <a asp-action="Create" class="btn btn-primary active" role="button" aria-pressed="true">新建数据</a>
    </p>
    <form asp-controller="Person" asp-action="Index">
        <p class="col-md-4">
            <input type="text" name="keyword" placeholder="输入关键词">
            <input type="submit" value="搜索" class="btn btn-primary" />
        </p>
    </form>
</div>


<table class="table table-bordered">
    <thead>
        <tr>
            <th>
                编号
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ID)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.OrderNumber)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Email)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Mobile)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SortCode)
            </th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.ID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.OrderNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Mobile)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SortCode)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.ID" class="btn btn-default btn-sm">编辑</a>
                    <a asp-action="Details" asp-route-id="@item.ID" class="btn btn-default btn-sm">详细</a>
                    <a asp-action="isDelete" asp-route-id="@item.ID" class="btn btn-warning btn-sm">删除</a>



                </td>
                @*<td>
                        @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
                        @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                        @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
                    </td>*@
            </tr>
        }
    </tbody>
</table>
